1. Field of the Invention
The present invention relates to an image processing method capable of processing an image, and an apparatus therefor.
2. Description of the Related Art
It is known to provide a system in which an image is scaled, and a resulting scaled image is subjected to known discrete cosine transform (DCT) processing and quantization processing to obtain plural coefficients from which several coefficients are picked up from low frequency component side, and the picked-up coefficients is regarded as a characteristic amount for an original image and is used as data for searching the image (refer to ISO/IEC JTC1/SC29/WG11/N3522 “MPEG-7 Visual Working Draft 4.0” ([VWD 4.0]) or ISO/IEC JTC1/SC29/WG11/N3522 “MPEG-7 Visual part of experimentation Model Version 7.0” ([VXM 7.0]).
FIG. 1 is a view showing characteristic data extracting processing in Color Layout descriptor described in the above document [VWD 4.0] or [VXM 7.0]. Further, FIG. 8 is a flow chart showing such processing.
An original image 10001 is scaled down into 8×8 pixels (step S10401), and each pixel of resulting 8×8 pixel images (10011, 10012, 10013) is converted into Y/Cb/Cr color space data (10021, 10022, 10023) (step S10402). Then, Y, Cb and Cr data components 10021, 10022, 10023 are subjected to DCT processing (step 10403) to obtain DCT coefficients 10031, 10032, 10033, and the coefficients 10031, 10032, 10033 are subjected to quantization processing (step S10404).
The image scaling processing, color conversion processing and DCT conversion processing may be well-known ones.
For example, according to [VWD 4.0], the quantization processing can be realized by processing shown in the following program codes 10000–10003. The program codes 10000–10003 are described by using well-known C language. According to the above document, in the quantization processing, since different processing operations are effected for a DC component and an AC component with respect to Y component and Cb/Cr components, the above document presents four program codes 10000–10003 for the quantization processing. Program code 10000: Quantization processing for DC component of Y coefficient
Int quant_Y_DC(int i)int j;i=i/8;if(i>192)j= 1 1 2+(i·192)/4;else if(i>160)j=96+(i·160)/2;else if(i>96)j=32+i·96;else if(i>64)j=16+(i·64)/2;else j=i/4;return j>>1;}Program code 10001: Quantization processing for DC component of Cb/Cr coefficients
Int quant_CbCr_DC(int i)int j;i=i/8;if(i>191)j=63;else if(i>160)j=56+(i·160)/4;else if(i>144)j=48+(i·144)/2;else if(i>112)j=16+ I ·112;else if(i>96)j=8+(i·96)/2;else if(i>64)j=(i·64)/4;else j=i/0;Program code 10002: Quantization processing for AC component of Y coefficient
Int quant_Y_AC(int i) {int j;i=i/2;if(i>255)I=255;if(i<·256)I=·256;if(abs(i)>127)j=64+abs(i)/4;else if(abs(i)>63)j=32+abs(i)/2;else j=abs(i);j=(i<0)?·j:j;return(int)trunc(((double)j+128.0)/8.0+0.5);}Program code 10003: Quantization processing for AC component of Cb/Cr coefficients
Int quant_CbCr_AC(int i){int j;if(i>255)I=255;if(i<·256)i=·256;if(abs(i)>127)j=64+abs(i)/4;else if(abs(i)>63)j=32+abs(i)/2;else j=abs(i);j=(i<0)?·j:j;return(int)trunc(((double)j+128.0)/8.0+0.5);}
As a result of the quantization processing using the program codes 10000 and 10001, the quantization-processed DCT coefficients (refer to as “quantization DCT coefficients” hereinafter) of Y or Cb/Cr components have values between 0 and 64. Further, as a result of the quantization processing using the program codes 10002 and 10003, the quantization DCT coefficients of Y or Cb/Cr components have values between 0 and 32.
Accordingly, the DC component of the quantization DCT coefficient can be represented by 6 bits (no sign) and the AC component can be represented by 5 bits (no sign).
Further, among the quantization DCT coefficient 10041, 10042, 10043 obtained by the quantization processing, several coefficients are selected from a low frequency component side (step S10405). In case of FIG. 4, as an example, six coefficients are selected regarding the Y component coefficients and three coefficients are selected regarding each of the Cb/Cr component coefficients. The selection of the coefficients is actually realized by re-placing coefficients arranged 8×8 two-dimensional pattern into coefficients arranged in a one-dimensional pattern by means of a zigzag scan shown in FIG. 1 and selecting several leading coefficients from the one-dimensional pattern. The reference numeral 10101 in FIG. 5 shows the zigzag scan. Numbers from 1 to 64 written in blocks of the scan 10101 represent orders (from a leading order (1)) of the related coefficients after they were re-placed into the one-dimensional pattern.
Lastly, several coefficients are picked up from a low frequency component side. According to [VWD 4.0], the number of coefficients picked up here is 1, 3, 6, 10, 15, 21, 28 or 64. Further, although the number of the Cb component coefficients is the same as that of the Cr component coefficients, the number of the Y component coefficients may be differentiated from the number of the Cb/Cr component coefficients. According to [VWD 4.0], regarding default, six Y component coefficients and three Cb/Cr component coefficients are selected. In FIG. 4, as an example, six Y component coefficients (10051) and three Cb/Cr component coefficients (10052, 10053) are selected as coefficients in the default.
The selected coefficients 10051, 10052, 10053 are used as characteristic data of the original image 10001, i.e., Color Layout descriptor data.
Further, according to [VWD 4.0], the Color Layout descriptor is stored in a form of a binary structure as shown in FIG. 6 or FIG. 7. In the structure 10201 of FIG. 6 and the structure 10301 of FIG. 7, each square block represents one bit. Further, in the structures 10201, 10301, although items are written in partition from field to field for the convenience of explanation, actually, the items are continuously stored in an order as shown by the broken lines in FIG. 6 and FIG. 7.
FIG. 6 is a view showing the binary structure when Color Layout descriptor is default, i.e., when the number of Y quantization DCT coefficients is six and the number of Cb/Cr quantization DCT coefficients is three. In this case, “0” is stored in a leading extension flag. Following to this, six Y quantization DCT coefficients, three Cb quantization DCT coefficients and three Cr quantization DCT coefficients are stored in order. As mentioned above, as a result of quantization, regarding the quantization DCT coefficient, since the DC component can be represented by 6 bits (no sign) and the AC component can be represented by 5 bits (no sign), the DC component is stored in a 6-bits area and the AC component is stored in a 5-bits area.
On the other hand, FIG. 7 is a view showing the binary structure when Color Layout descriptor is not default. In this case, “1” is stored in a leading extension flag. This is followed by two 3-bits areas. These 3-bits areas are used for representing the number of Y quantization DCT coefficients and the number of Cb/Cr quantization DCT coefficients, respectively.
TABLE 10001Bit pattern for coefficientdesignating field and meaning thereofBit patternNumber of quantization DCT coefficients000 1001 3010 60111010015101211102811164
Following to these two 3-bits coefficient designating fields, Y, Cb and Cr quantization DCT coefficients are stored in order. The numbers of the Y, CB and Cr coefficients are the numbers of coefficients designated by the above-mentioned coefficient designating fields. In 10301 of FIG. 7, as an example, the number of Y quantization DCT coefficients is six and the number of Cb/Cr quantization DCT coefficients is six.
Further, according to [VXM 7.0], similarity between the characteristic data is calculated the following equation. For example, similarity D between two Color Layout descriptors, i.e., CLD1 (Y Coeff, Cb Coeff, Cr Coeff) and CLD2 (Y Coeff′, Cb Coeff′, Cr Coeff′) calculated by the following equation 10001:
[6]
  D  =                              ∑                      i            =            0                                              Max              ⁢                              {                NumberOfYCoeff                }                                      -            1                          ⁢                                            λ              Yi                        ⁡                          (                                                YCoeff                  ⁡                                      [                    i                    ]                                                  -                                                      YCoeff                    ′                                    ⁡                                      [                    i                    ]                                                              )                                2                      +                            ∑                      i            =            0                                              Max              ⁢                              {                NumberOfYCCoeff                }                                      -            1                          ⁢                                            λ              Cbi                        ⁡                          (                                                CbCoeff                  ⁡                                      [                    i                    ]                                                  -                                                      CbCoeff                    ′                                    ⁡                                      [                    i                    ]                                                              )                                2                      +                            ∑                      i            =            0                                              Max              ⁢                              {                NumberOfYCCoeff                }                                      -            1                          ⁢                                            λ              Cri                        ⁡                          (                                                CrCoeff                  ⁡                                      [                    i                    ]                                                  -                                                      CrCoeff                    ′                                    ⁡                                      [                    i                    ]                                                              )                                2                    
In the above equation 10001 for calculating Color Layout descriptor, λ is weighting regarding the respective coefficients, and, in [VXM 7.0], weighting values shown in the following Table 10002 are described:
TABLE 10002Weighting values in equation 10001Order of coefficient123456Y222111Cb211Cr422
Further, if the numbers of coefficients included in two descriptors are different, the equation 10001 is applied to the fewer number, or value “16” is supplemented to the deficient number and the equation 10001 is applied to the higher number.
Regarding the selection of the numbers of quantization DCT coefficients included in Color Layout descriptor, in case of default, six is selected for Y and three is selected for Cb/Cr. Normally, it was required that such a coefficient selecting method is uniformly determined in a system by predetermining it by the system or is designated by the user case by case.
However, the default coefficient selecting method is not always all-around and is not sufficient to represent characteristics of all of images. If insufficient, searching accuracy of the entire searching system will be subjected to a bad influence.
On the other hand, to avoid this, it is considered that selection of coefficients is effected to obtain more coefficient data or all coefficient data are held. In this case, however, a characteristic amount data size naturally becomes bulky. This may lead to an undesirable case in which the number of images to be treated increased greatly or data capacity is severely limited by a storing area or a communication path.
Accordingly, in order to efficiently utilize Color Layout descriptor without affecting a bad influence upon the searching accuracy, the number of quantization DCT coefficients held for each image must be determined suitably.